{$CLEO .cs}

// Autor: DM LOQUENDO
// Ao: 2024
write_debug "LINTERNA, AUTOR DM LOQUENDO, 2024"
script_name 'LINTERNA'

:LINTERNA_60
wait 2000
goto @LINTERNA_65

:LINTERNA_65
wait 1
if 
  Player.Defined($PLAYER_CHAR)
else_jump @LINTERNA_60
if and
  not Actor.Driving($PLAYER_ACTOR)
  TIMERA >= 1200
  0@ == 0
  is_key_pressed 70 // Cambiar a la tecla "F"
else_jump @LINTERNA_339
Model.Load(324)
load_all_models_now 
if 
  not Actor.HasWeapon($PLAYER_ACTOR, 13)
else_jump @LINTERNA_154
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, WeaponType.Vibe2, 1) // Asegurarse de que el jugador tenga el arma gun_vibe2

:LINTERNA_154
wait 10
set_current_char_weapon $PLAYER_ACTOR 13 // Equipar el arma gun_vibe2
Object.Init(1@, 324, 0.0, 0.0, 0.0)
0@ = 1
Model.Destroy(324)
task_pick_up_object $PLAYER_ACTOR 1@ 0.0 0.0 0.0 6 16 "NULL" "NULL" -1
get_offset_from_object_in_world_coords 2@ 3@ 4@ 1@ 0.08 0.03 0.14
get_offset_from_object_in_world_coords 5@ 6@ 7@ 1@ 1.58 0.03 2.14
create_searchlight 8@ at 2@ 3@ 4@ radius 0.0 target 5@ 6@ 7@ radius 14.0
TIMERA = 0

:LINTERNA_339
if 
  0@ == 1
else_jump @LINTERNA_453
delete_searchlight 8@
get_offset_from_object_in_world_coords 2@ 3@ 4@ 1@ 0.08 0.03 0.14
get_offset_from_object_in_world_coords 5@ 6@ 7@ 1@ 1.58 0.03 2.14
create_searchlight 8@ at 2@ 3@ 4@ radius 0.0 target 5@ 6@ 7@ radius 14.0

:LINTERNA_453
if and
  TIMERA >= 1200
  0@ == 1
  is_key_pressed 70 // Cambiar a la tecla "F"
else_jump @LINTERNA_507
0@ = 0
delete_searchlight 8@
Object.Destroy(1@)
TIMERA = 0

:LINTERNA_507
if and
  0@ == 1
  not is_current_char_weapon $PLAYER_ACTOR 13 // Asegurarse de que el arma equipada es gun_vibe2
else_jump @LINTERNA_549
0@ = 0
delete_searchlight 8@
Object.Destroy(1@)

:LINTERNA_549
goto @LINTERNA_65








